﻿@model PinCity.Models.ViewModels.LoginViewModel
@{
    ViewBag.Title = "Login";
}
<h2>
    Login</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>LoginViewModel</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Login)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Login)
            @Html.ValidationMessageFor(model => model.Login)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.PasswordFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>
        @if (Model != null && !String.IsNullOrWhiteSpace(Model.ErrorMessage))
        {
            <div class="field-validation-error">
            @Model.ErrorMessage
            </div>
        }
        <p>
            <input type="submit" value="Log In" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
